package com.codingapi.auto.deploy.ato;

import com.jcraft.jsch.UserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author modificial
 * @date 2018/7/23
 * @company codingApi
 * @description
 */
public class MyUserInfo implements UserInfo {

private static final Logger LOGGER=LoggerFactory.getLogger(MyUserInfo.class);

        @Override
        public String getPassphrase() {
            LOGGER.info("MyUserInfo.getPassphrase()");
            return null;
        }

        @Override
        public String getPassword() {
            LOGGER.info("MyUserInfo.getPassword()");
            return null;
        }

        @Override
        public boolean promptPassphrase(String arg0) {
            LOGGER.info("MyUserInfo.promptPassphrase()");
            LOGGER.info(arg0);
            return false;
        }

        @Override
        public boolean promptPassword(String arg0) {
            LOGGER.info("MyUserInfo.promptPassword()");
            LOGGER.info(arg0);
            return false;
        }

        @Override
        public boolean promptYesNo(String arg0) {
            LOGGER.info("MyUserInfo.promptYesNo()");
            LOGGER.info(arg0);
            if (arg0.contains("The authenticity of host")) {
                return true;
            }
            return true;
        }
        @Override
        public void showMessage(String arg0) {
            LOGGER.info("MyUserInfo.showMessage()");
        }

    }
